/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package scserver03;

import java.io.DataOutputStream;
import java.io.IOException;
import java.net.ServerSocket;
import java.net.Socket;

/**
 *
 * @author laoxu
 */
public class SCServer03 {
       static SCServer03 scs = new SCServer03();
    /**
     * @param args the command line arguments
     */
    public static void main(String[] args) throws IOException {
        // TODO code application logic here
        System.out.println("开始监听......");
        scs.startServer(10000);
    }
    public void startServer(int port) throws IOException{
        ServerSocket ss = new ServerSocket(port);
        while(true){
            Socket cs = ss.accept();
            System.out.println(cs.getInetAddress() + "连接上来了");
            DataOutputStream dos = new DataOutputStream(cs.getOutputStream());
            new SendScreenImage(dos).start();
        }
    }
}
